<?php

namespace Home\Model;
use Think\Model;
class ClassgoodModel extends BaseModel
{

    public function findNav()
    {
        $nav = M('classgood')->where('pid = 0 and  navgroom =  "1"')->order('sort desc')->limit(10)->select();
        //dump($nav);
        for($i=0;$i<count($nav);$i++){
            $nav[$i]['erji'] =  M('classgood')->where('pid = "'.$nav[$i]['id'].'"')->order('sort desc')->select();
        }
        //dump($nav);
        /*$sql = "";
        $nav = $this->sql_query($sql);*/
        return $nav;

    }






}